/**
 * 
 */
package nl.boektrust.btsoep.shared.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import com.google.gwt.user.client.rpc.IsSerializable;
import com.googlecode.objectify.annotation.Serialized;

/**
 * @author rao3
 *
 */
public class SupplyDetail implements Serializable,IsSerializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4910509871779148366L;
	private AvailabilityCode availabilityCode;
	private Date modificationDate;
	@Serialized private ArrayList<Price> priceArray;
	@Serialized private Supplier supplier;
	
	/**
	 * @return the supplier
	 */
	public Supplier getSupplier() {
		return supplier;
	}
	/**
	 * @param supplier the supplier to set
	 */
	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}
	/**
	 * @return the availabilityCode
	 */
	public AvailabilityCode getAvailabilityCode() {
		return availabilityCode;
	}
	
	/**
	 * @param availabilityCode the availabilityCode to set
	 */
	public void setAvailabilityCode(AvailabilityCode availabilityCode) {
		this.availabilityCode = availabilityCode;
	}
	/**
	 * @return the modificationDate
	 */
	public Date getModificationDate() {
		return modificationDate;
	}
	
	/**
	 * @param modificationDate the modificationDate to set
	 */
	public void setModificationDate(Date modificationDate) {
		this.modificationDate = modificationDate;
	}
	/**
	 * @param availabilityCode
	 * @param modificationDate
	 */
	public SupplyDetail(AvailabilityCode availabilityCode, Date modificationDate) {
		super();
		this.availabilityCode = availabilityCode;
		this.modificationDate = modificationDate;
		this.priceArray = new ArrayList<Price>();
	}
	
	public SupplyDetail() {
		this(AvailabilityCode.UNDEFINED, new Date());
	}
	public void addPrice(Price price) {
		priceArray.add(price);
	}
	/**
	 * @return the priceArray
	 */
	public ArrayList<Price> getPriceArray() {
		return priceArray;
	}

}
